<template>
    <div class="mt-96">
        <DlPlayerDetail v-if="$route.query.type==1"></DlPlayerDetail>
        <DlHatchetDetail v-if="$route.query.type==2"></DlHatchetDetail>
        <DlStoreDetail v-if="$route.query.type==3 || $route.query.type==4"></DlStoreDetail>
    </div>
</template>

<script>
    import DlHatchetDetail from './DlHatchetDetail.vue'
    import DlPlayerDetail from './DlPlayerDetail.vue'
    import DlStoreDetail from './DlStoreDetail.vue'
    export default {
        name: '',
        data () {
            return {
                type: 0, /*1,玩家;2,打手;3,玩家进行中店铺单子;4,店铺代练中单子*/
            }
        },
        components: {
            DlHatchetDetail,
            DlPlayerDetail,
            DlStoreDetail
        },
        computed: {},
        created(){
            /* var self = this;
             this.getProgress({orderId: this.$route.query.orderNum});
             this.getOrderInfo(this.$route.query.orderNum)
             .then((orderInfo)=>{
             //console.log(orderInfo);
             if (self.levelingOrder.gameName != '守望先锋' && self.levelingOrder.orderType != 5) {
             this.publish = true;
             }
             if (self.levelingOrder.orderType == 5) {
             self.$bus.emit('headerText', `陪练中`);
             } else {
             self.$bus.emit('headerText', `代练中`);
             }
             });*/
        },
        mounted: function () {

        },
        destroyed(){
            var self = this;
            self.$bus.emit('headerText', '');
        },
        methods: {
            /* ...mapActions({
             getOrderInfo: 'GET_ORDERINFO',
             getProgress: 'GET_PROGRESS'
             }
             ),*/
            /* getMyDate(str) {
             var oDate = new Date(str);
             var oMonth, oDay, oHour, oMin, oTime;

             function toauto(s) {
             return s < 10 ? '0' + s : s;
             };
             oMonth = oDate.getMonth() + 1,
             oDay = oDate.getDate(),
             oHour = oDate.getHours(),
             oMin = toauto(oDate.getMinutes()),

             oTime = oMonth + '-' + oDay + ' ' + oHour + ':' + oMin;//最后拼接时间
             return oTime;
             },
             next(){
             this.$router.push({
             name: 'PlPublish',
             query: {
             'gName': this.levelingOrder.gameName,
             'aName': this.levelingOrder.regionName,
             'sName': this.levelingOrder.serverName,
             'gameId': this.levelingOrder.gameId
             }
             });
             },
             confirm(){
             this.postData.orderNum = this.$route.query.orderNum;

             this.$messagebox({
             message: '是否确定完成?',
             showCancelButton: true,
             confirmButtonClass: "dlMessageboxConfrim",
             cancelButtonClass: "dlMessageboxCancel",
             }).then(action => {
             if (action == "confirm") {
             this.$http.post(this.$CONSTANTS.APIdl + 'bullyOrder/applycomplete', this.postData).then((res) => {
             console.log(res);
             this.getOrderInfo(this.$route.query.orderNum);
             this.getProgress({orderId: this.$route.query.orderNum});
             }, (res) => {
             console.log(res)
             });
             } else {
             return false
             }
             });
             },
             appeal(){
             this.$router.push({name: 'DlBuyerAppeal', query: {orderNum: this.$route.query.orderNum, type: 2}})
             }*/
        }
    }
</script>


<style>
    .dlMessageboxConfrim {
        order: 1;
    }

    .dlMessageboxCancel {
        order: 2;
        border-left: 1px solid #ddd !important;
    }
</style>

